Skip to content

Promoting new bundle directory structure as best practice #14993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2021

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented Feb 17, 2021

As Symfony 3.4 is not currently supported (security fixes only) I would like to propose to start promoting the new bundle directory structure (compatible since 4.4) consistent with the project one.

What do you think?

Fix: #12156
PR: symfony/symfony#32845

@yceruto yceruto force-pushed the bundles_structure branch 2 times, most recently from a446761 to 7ae696f Compare February 17, 2021 14:44
@javiereguiluz
Copy link
Member

What's our official recommendation for existing third-party bundles that no longer support 3.4. Do we encourage them to upgrade their structure or it's better to use this only in brand-new bundles?

Related to the previous question, even if we don't recommend to change the structure for existing bundles, can you think of any problem if they do? Thanks!

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Do we encourage them to upgrade their structure or it's better to use this only in brand-new bundles?

They can do whatever they want. Im not sure we should give an opinon. Both work and we find the new structure to be better. Where "better" means, more "PHP" and less "symfony specific"


class AcmeBlogBundle extends Bundle
{
public function getPath(): string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, should we deprecate not overriding this method, so that we can make this the default in sf 6.0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering the same thing, I think we can do that when we decide to start depreciating the old structure.

@OskarStark OskarStark added this to the 4.4 milestone Feb 17, 2021
Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should target 4.4 👍

@yceruto
Copy link
Member Author

yceruto commented Feb 17, 2021

What's our official recommendation for existing third-party bundles that no longer support 3.4. Do we encourage them to upgrade their structure or it's better to use this only in brand-new bundles?

As long as the old structure is kept alive, I don't think we should encourage upgrading, at least not now. Maybe when we start deprecating the old structure.

Related to the previous question, even if we don't recommend to change the structure for existing bundles, can you think of any problem if they do? Thanks!

As long as the bundle is strictly compatible with Sf >= 4.4 shouldn't be a problem 🤞

@stof
Copy link
Member

stof commented Feb 17, 2021

maybe the doc should have a note saying that this structure can be used only when requiring symfony/http-kernel 4.4+ only, to avoid issues with bundle migrating to it (due to reading the new doc) without changing their min version.

@yceruto yceruto changed the base branch from 5.x to 4.4 February 17, 2021 18:08
@yceruto yceruto requested a review from xabbuh as a code owner February 17, 2021 18:08
@yceruto
Copy link
Member Author

yceruto commented Feb 17, 2021

Updated:

  • @stof, comments addressed and added versionadded:: note.
  • @OskarStark, rebased on 4.4 branch.
  • consistent vendor/bundle naming

@javiereguiluz javiereguiluz merged commit c3e1da1 into symfony:4.4 Feb 18, 2021
@javiereguiluz
Copy link
Member

Fantastic changes! Thanks Yonel. Merged!

@yceruto yceruto deleted the bundles_structure branch February 18, 2021 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HttpKernel][FrameworkBundle] Add alternative convention for bundle directories
7 participants